home *** CD-ROM | disk | FTP | other *** search
/ System Booster / System Booster.iso / SYS / s / SelectDoc.bed < prev    next >
Text File  |  1996-09-26  |  780b  |  52 lines

  1. /*
  2. ** $VER: SelectDoc.bed 1.0 (02.01.96)
  3. **
  4. ** Shows a list of the documents currently loaded in Blacks Editor and
  5. ** asks for the number of the document to be activated.
  6. */
  7.  
  8.  
  9. OPTIONS RESULTS
  10. OPTIONS PROMPT "Select document > "
  11. OPTIONS FAILAT 21
  12. PARSE ARG name
  13.  
  14. ADDRESS BED
  15.  
  16. IF name = "" THEN DO
  17.     GetDocuments
  18.     docs = RESULT
  19.     SAY "Available documents:"
  20.  
  21.     i=1
  22.  
  23.     DO WHILE docs ~= ""
  24.         PARSE VAR docs '"'file'"' file.i docs
  25.         IF file = "" THEN file = "Untitled"
  26.         SAY ' ' i ':' file
  27.         i = i+1
  28.     END
  29.  
  30.     IF i=1 THEN DO
  31.         SAY "No documents loaded"
  32.         RETURN
  33.     END
  34.  
  35.     PULL n
  36.  
  37.     IF n = "" THEN RETURN
  38.  
  39.     ADDRESS VALUE file.n
  40. END; ELSE DO
  41.     GetPort name
  42.     ADDRESS VALUE RESULT
  43. END
  44.  
  45. IF RC = 0 THEN DO
  46.     Screen2Front
  47.     IconifyWindow OFF
  48.     ActivateWindow FRONT
  49. END; ELSE DO
  50.     SAY "Document not found"
  51. END
  52.